home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / BUS / DynRisk 68k 4.01 demo.sit / DynRisk-Help.rsrc / TEXT_6527.txt < prev    next >
Text File  |  1996-08-30  |  1KB  |  17 lines

  1. Trunc
  2.  
  3. The Trunc function. This function lets you replace a linear function of the input value by the closest integer which is less than this linear function, multiplied by a constant. By adjusting the parameters, you can create a large variety of round-off rules. Assume, e.g., that you want to replace the input value by the closest multiple of 0.5 which is less than the input value. To do this, enter 0.5 into the 窶彗窶 field, 2 into the 窶彙窶 field, and 0 into the 窶彡窶 field.
  4.  
  5. More generally, let A be a positive number. To replace the input value by the closest multiple of A which is less than the input value, enter A into the 窶彗窶 field, 1/A into the 窶彙窶 field, and 0 into the 窶彡窶 field. 
  6.  
  7. Similarly, let B be a negative number. To replace the input value by the closest multiple of B which is greater than the input value, enter B into the 窶彗窶 field, 1/B into the 窶彙窶 field, and 0 into the 窶彡窶 field.
  8.  
  9. Default parameter values:
  10.     a = 1, b = 1, c = 0
  11.  
  12. Example:
  13.     a = 10, b = 0.1, c = 0
  14.  
  15.     Input = 42  =>  Output = 40
  16.     Input = 56  =>  Output = 50
  17.